<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
<!--    <script th:srchttp://cdn.sockjs.org/sockjs-0.3.min.js"></script>-->
<!--<script th:src="@{/webjars/sockjs-client/0.3.4/sockjs.js}"></script>-->
    <script src="./sockjs.js"></script>
    <script>
        var url = 'http://localhost:8084/foo';
        var sock = new SockJS(url);
        sock.onopen = function (e) {
            window.alert('open: ' + e.data)
            sayMarry("TradeMessageHandle");
            sayMarry("FruitMessageHandle");
        };
        sock.onmessage = function (e) {
        window.alert(e.data)
        };
        sock.onclose = function (e) {
            window.alert('close: ' + e.data)
        };

        function sayMarry(data) {
            sock.send(data)
        };
    </script>
</head>
<body>
</body>
</html>